"use strict";
/**
 * 设计一个函数，传递一个对象和key，返回对应值
 */
function getValueByKey(obj, key) {
    // key ---> id name
    // keyof IClasses = ["id","name"]
    return obj[key];
}
// keyof ITeacher --->[address,age,level]
const classes01 = {
    id: 1,
    name: "10期"
};
const teacher01 = {
    address: "",
    age: 23,
    level: 1
};
getValueByKey(classes01, "name");
function getValueByKey2(obj, key) {
    return obj[key];
}
getValueByKey2(classes01, "id");
getValueByKey2(teacher01, "mo");
